<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关键帧动画-轮播案例</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .swiper-container{
            width: 640px;
            height: 300px;
            margin: 0 auto;
            overflow: hidden;
        }
        .swiper-wrapper img{
            width: 640px;
            height: 300px;
        }
        .swiper-slide{
            float: left;
        }
        .swiper-wrapper{
            width: 9999px;
            animation: swiperrun 10s linear infinite;
        }
        .swiper-wrapper:hover{
            animation-play-state: paused;
        }
        @keyframes swiperrun {
            0%{
                transform: translateX(0);
            }
            5%{
                transform: translateX(-640px);
            }
           25%{
                transform: translateX(-640px);
            }
            30%{
                transform: translateX(-1280px);
            }
            50%{
                transform: translateX(-1280px);
            }
            55%{
                transform: translateX(-1920px);
            }
            75%{
                transform: translateX(-1920px);
            }
            80%{
                transform: translateX(-2560px);
            }
            100%{
                transform: translateX(-2560px);
            }
        }
    </style>
</head>
<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <img src="img4/1.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img4/2.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img4/3.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img4/4.jpg" alt="">
            </div>

            <!-- 为了实现无缝轮播，最后一份跟第一份是一样的 不会有突兀的感觉 -->
            <div class="swiper-slide">
                <img src="img4/1.jpg" alt="">
            </div>
        </div>
    </div>
</body>
</html>